// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/parking/api/ParkDashboardApi'

import InfoClass from '@api/parking/model/SpaceCountByAreaReq'

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 信息 —————————————————————————————— //

  transInfoParam(infoParam, { rootState: { map: { param } } }) {
    return param
  },
  async getInfo(param, TIP = '查询车位概况') {
    const DTO = CORE.grpcDTO(InfoClass, param)
    const resp = await CORE.grpc(TIP, CLIENT, 'QuerySpaceCountByArea', DTO)
    return resp
  },
  transInfo(obj) {
    obj.all = obj.all || {}
    return obj
  },
}
